package com.md.value.enums;

import com.md.base.EnumBase;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author 刘骄阳
 * 2022-12-06 22:51
 */
@Getter
@AllArgsConstructor
public enum HasAnnotationEnum implements EnumBase {

  /**
   * 不含有
   */
  UN_HAS(0, "UN_HAS"),
  /**
   * 含有
   */
  HAS(1, "HAS");


  private static final Map<Integer, HasAnnotationEnum> ENUM_MAP = Arrays.stream(HasAnnotationEnum.values())
    .collect(Collectors.toMap(EnumBase::getCode, e -> e));
  private final Integer code;
  private final String message;

  public static HasAnnotationEnum of(final Integer code) {
    return ENUM_MAP.get(code);
  }
}
